﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RuiJing.Web.Areas.Manage.Models.SystemModels.EditModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=Model.ID.Name() %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
<% Html.BeginForm(new { id="editform"}, new { Model.ID }); %>
    <fieldset>
        <legend><%=Model.ID.Name() %></legend>
        <ul class="editpanel">
            <li class="edititem">
                <div id="tabs">
                    <ul>
                        <% foreach (var item in Model.Info.Select(p=>p.Language)) %>
                        <% { %>
                        <li><a href='#<%=item %>'><span><%=item.Name() %></span></a></li>
                        <% } %>
                    </ul>
                    <% Model.Info.Each((n, i) => %>
                    <% { %>
                    <div id='<%=n.Language %>'>
                        <%=Html.TextAreaFor(p => p.Info[i].Value)%>
                        <%=Html.HiddenFor(p => p.Info[i].Language)%>
                    </div>
                    <% }); %>
                </div>
            </li>
            <li class="edititem btnpanel">
                <input type="submit" value="保存" />
            </li>
        </ul>
    </fieldset>
<% Html.BeginForm(); %>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StypeAndScript" runat="server">
    <style type="text/css">
        #editform table{ line-height:normal; }
        #editform table{margin:0px; text-align:left; padding:0px;}
    </style>
    <script src='<%=Url.Content("~/Scripts/htmlbox4.0/htmlbox.colors.js") %>' type="text/javascript"></script>
    <script src='<%=Url.Content("~/Scripts/htmlbox4.0/htmlbox.styles.js") %>' type="text/javascript"></script>
    <script src='<%=Url.Content("~/Scripts/htmlbox4.0/htmlbox.syntax.js") %>' type="text/javascript"></script>
    <script src='<%=Url.Content("~/Scripts/htmlbox4.0/htmlbox.full.js") %>' type="text/javascript"></script>
    <script src='<%=Url.Content("~/Scripts/htmlbox4.0/xhtml.js") %>' type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var g = {
                select: function (e, n) {
                    var p = $(n.panel);
                    if (p.is(".htmlarea"))
                        return;
                    var ss=html(p.find("textarea"));
                    p.addClass("htmlarea");
                },
                selected:1
            };
            var tb = $("#tabs").tabs(g);
            tb.tabs("select",0);
        });

        function html(item) { 
            return item.css({ width: "100%", height: "400px" }).htmlbox({
                toolbars: [
                [
                // Cut, Copy, Paste
                "separator", "cut", "copy", "paste",
                // Undo, Redo
                "separator", "undo", "redo",
                // Bold, Italic, Underline, Strikethrough, Sup, Sub
                "separator", "bold", "italic", "underline", "strike", "sup", "sub", "removeformat",
                // Left, Right, Center, Justify
                "separator", "justify", "left", "center", "right",
                // Ordered List, Unordered List, Indent, Outdent
                "separator", "ol", "ul", "indent", "outdent",
                // Hyperlink, Remove Hyperlink, Image
                "separator", "link", "unlink", "image"
                ],
                [// Show code
                "separator", "code",
                // Formats, Font size, Font family, Font color, Font, Background
                "separator", "formats", "fontsize", "fontfamily",
                "separator", "fontcolor", "highlight"
                ]
                ],
                skin: "blue",
                idir: '<%=Url.Content("~/Scripts/htmlbox4.0/images/") %>',
                about: false
            });
        }
    </script>
</asp:Content>
